﻿<Page x:Class="NorthwindClient.TestGroupControlBinding"
	  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
	  xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
	  mc:Ignorable="d" 
	  d:DesignHeight="663" d:DesignWidth="1060"
	Title="TestGroupControlBinding" Loaded="Page_Loaded">
	<StackPanel>
		<Button x:Name="btnBack" Content="&lt;--" Width="40" HorizontalContentAlignment="Center" HorizontalAlignment="Left" Click="btnBack_Click" Foreground="#FF0F7AC1"></Button>
		<Label x:Name="lblTitle">Test ItemsControl</Label>
		<ItemsControl x:Name="itcGroup" Height="593" Width="1040">
			<!-- ItemsPanelTemplate -->
			<ItemsControl.ItemsPanel>
				<ItemsPanelTemplate>
					<Grid>
						<Grid.RowDefinitions>
							<RowDefinition Height="10*" />
							<RowDefinition Height="1*" />
							<RowDefinition Height="10*" />
							<RowDefinition Height="1*" />
							<RowDefinition Height="10*" />
							<RowDefinition Height="1*" />
							<RowDefinition Height="10*" />
						</Grid.RowDefinitions>
						<Grid.ColumnDefinitions>
							<ColumnDefinition Width="10*"/>
							<ColumnDefinition Width="1*"/>
							<ColumnDefinition Width="10*"/>
							<ColumnDefinition Width="1*"/>
							<ColumnDefinition Width="10*"/>
							<ColumnDefinition Width="1*"/>
							<ColumnDefinition Width="10*"/>
							<ColumnDefinition Width="1*"/>
							<ColumnDefinition Width="10*"/>
							<ColumnDefinition Width="1*"/>
							<ColumnDefinition Width="10*"/>
							<ColumnDefinition Width="1*"/>
							<ColumnDefinition Width="10*"/>
							<ColumnDefinition Width="1*"/>
							<ColumnDefinition Width="10*"/>
						</Grid.ColumnDefinitions>
					</Grid>
				</ItemsPanelTemplate>
			</ItemsControl.ItemsPanel>

			<!-- ItemContainerStyle -->
			<ItemsControl.ItemContainerStyle>
				<Style>
					<Setter Property="Grid.Column"
					Value="{Binding GridColumn}" />
					<Setter Property="Grid.Row"
					Value="{Binding GridRow}" />
					<Setter Property="Grid.ColumnSpan"
					Value="{Binding GridColumnSpan}" />
					<Setter Property="Grid.RowSpan"
					Value="{Binding GridRowSpan}" />
				</Style>
			</ItemsControl.ItemContainerStyle>

			<!-- ItemTemplate -->
			<ItemsControl.ItemTemplate>
				<DataTemplate>
					<Button Content="{Binding Label}" />
				</DataTemplate>
			</ItemsControl.ItemTemplate>
		</ItemsControl>
	</StackPanel>
</Page>
